package com.lanmao.emc.enums;

/**
 * 描述：支持的升级策略
 *
 * @author lanmao
 * @since 2024年11月11日 20:41
 */

public enum UpgradeType {
    MULTI_VERSION("multi_version"),
    ONE_MIGRATION("one_migration"),
    TWO_MIGRATION("two_migration");


    private final String strategy;

    UpgradeType(String strategy) {
        this.strategy = strategy;
    }

    public static UpgradeType getByValue(String strategy) {
        for (UpgradeType value : UpgradeType.values()) {
            if (value.strategy.equals(strategy)) {
                return value;
            }
        }
        return MULTI_VERSION;
    }

    public String getStrategy() {
        return strategy;
    }
}